#ifndef NEURON_H
#define NEURON_H

#include "global.h"
#include "function.h"

class Neuron;

class Link{
	friend class Neuron;
	friend class Network;
public:
	Link(Neuron *in_Neuron, Neuron *out_Neuron = 0);
	~Link();

	
private:
	Neuron *in_Neuron;
	Neuron *out_Neuron;
	double w;
	double prev_dw;
	double inVal;
};

class Neuron{
	friend class Network;
public:
	enum FUNCTION {SIGNUM, LOGISTIC, TANH};
	Neuron();
	~Neuron();

	int get_Input_Number();
	int get_Output_Number();
	void add_Input(Neuron * neuron = 0);
	void set_Function(enum FUNCTION function);
	void fire();
	
	double d_Func(double v);	
	double func(double v);
private:
	vector<Link *> input;
	vector<Link *> output;
	double delta;
	double out_Val;
	int function;
};

#endif
